The invention relates to allowing a computer user to use free form dynamically created electronic ink to interact with digitally represented mobile objects and relates to various techniques for processing collisions between the mobile objects and the ink.
Computer application programs, such as computer games, screen savers, and the like, may have objects that move around the display screen and interact with other objects within the application program. Computer games in which a ball or other similar moving object moves around and bounces off of walls, paddles, and the like are well known in the art. JezzBall is an example of such a game. FIGS. 1-4 are Jezzball screen shots. JezzBall begins by displaying a game board 100 of tiles 102. The game board initially represents a large area in which balls 104-1 and 104-2 bounce around off of each other and off of the walls 106-1 through 106-4. The two balls 104 move around the screen bouncing off each other and off of the walls 106 according to expected physics principles, such as that the angle of incidence of a collision between a ball and a wall will equal the angle of reflection of the ball as it leaves the wall after the collision. The object of the game is to trap the balls into progressively smaller areas by building horizontal and vertical walls. A person playing JezzBall builds a wall by positioning the cursor and clicking a mouse button. JezzBall builds walls from a central point in opposite vertical or horizontal directions. FIG. 2 shows a vertical wall being built in two wall sections 200-1 and 200-2. FIG. 3 shows a completed version of the wall 300, which was shown being built in FIG. 2.
FIG. 4 shows the balls 104 confined to small areas 400-1 and 400-2. A user interface element 402 indicates the percentage of the game board 100 that has been cleared. Once 75 percent of the game board has been cleared, the player advances to the next game board, which will have more balls than the previous game board.
Relative to the conventional keyboard and mouse input devices, computer systems are providing more natural ways for users to interact with their computers. One of these more natural ways is handwritten electronic ink. Accordingly, an application program, such as a computer game, that allows a user to interact naturally, via electronic ink, with mobile objects, such as bouncing balls and the like, within the game would be desirable.
Such a game, however, presents technical challenges regarding processing collisions between the mobile objects and free form electronic ink. Free form electronic ink refers to ink that may be entered by a user and that is not limited to predefined shapes and/or predefined orientations. The technical challenges are presented by the many orientations that the ink may have at locations at which a mobile object collides with the ink.
In contrast, conventional application programs, typically process collisions between mobile objects and a limited number of predefined shapes in predefined orientations. For instance, FIG. 5 depicts velocity vectors 504 and 506 of a conventional application program""s mobile object 500 (e.g., a ball) before and after, respectively, a collision with a flat horizontal surface 514 (e.g., a wall). The angle 516 of velocity vector 504 relative to the velocity vector""s vertical or y-coordinate component 502, before the collision, is equal to the angle 518 of velocity vector 506 after the collision. The mobile object""s velocity vector may be changed from 504, before the collision, to 506, after the collision, by negating the y component 502 of the mobile object""s velocity vector 504. The mobile object""s post-collision velocity vector 506, will then have an x component, 512 that is the same as the x component value 510 of pre-collision velocity vector 504, but a y component value 508 that is the inverse of the pre-collision y-component vector 502. Techniques for processing other types collisions, such as collisions with flat vertical surfaces, and collisions with circular shapes are also well known in the art.
Processing collisions between an application program""s mobile objects and free form electronic ink is more complicated than processing collisions for which the shapes and orientations are known at development time of the application program. Accordingly, relatively simple and efficient techniques for processing collisions between an application program""s mobile object and free form electronic ink would be desirable.
In accordance with the invention, a collision between a digitally represented mobile object and free form electronic ink is processed simply and efficiently. A collision angle is determined. The collision angle may bisect a first and last intersecting point along a periphery of the mobile object. The mobile object""s trajectory is then changed is such that the mobile object moves away from the ink as if the mobile object had collided with a flat surface that is oriented perpendicular to the collision angle.
The mobile object""s trajectory may be changed as a result of the collision by: rotating the mobile object""s velocity vector in a first direction by an amount that would make the collision surface orientation vertical; negating an x component value of the mobile object""s velocity vector; and rotating the mobile object""s velocity vector in a direction opposite to the first direction by the amount that would make the collision orientation vertical. Alternatively, the mobile object""s velocity vector could be rotated in a first direction by an amount that would make the collision surface orientation horizontal; a y component of the mobile object""s velocity vector could then be negated; and the mobile object""s velocity vector could then be rotated in a direction opposite to the first direction by the amount that would make the collision orientation horizontal.
A computer system, in accordance with the invention, includes an application program that uses an ink API. The ink API provides services for capturing, storing, and displaying ink entered by a user. The computer system includes: an input device for entering free form handwritten electronic ink, and an ink-based computer application program that includes a collision processing module. The collision processing module requests information from the ink API about whether free form ink, entered by a user at run time of the application program, exists at locations occupied by one or more selected mobile application-program objects. And the collision processing module causes a change to a trajectory of at least one of the selected mobile application-program objects, based on how the locations of the mobile application-program objects overlap with the free form ink.
An ink-based computer game, in accordance with the invention, provides a natural way, via handwritten electronic ink, for players of the game to interact with mobile objects within the game. The game may include colored balls; game boards; and free form handwritten electronic ink entered by a user while playing the game, wherein the balls bounce off of other balls, wall tiles, and the electronic ink and go through drainpipes in the game board.